﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Deployment.Data.Deploy.Steps
{
    /// <summary>
    /// Interaction logic for DuplicateStepDialog.xaml
    /// </summary>
    public partial class DuplicateStepDialog : Window
    {
        public static readonly DependencyProperty NewStepProperty =
            DependencyProperty.Register("NewStep", typeof(Step), typeof(DuplicateStepDialog), null);

        public static readonly DependencyProperty ExistingStepProperty =
            DependencyProperty.Register("ExistingStep", typeof(Step), typeof(DuplicateStepDialog), null);

        public event DependencyPropertyChangedEventHandler PropertyChanged;

        private void SetValueDp(DependencyProperty property, object value)
        {
            SetValue(property, value);
            if (PropertyChanged != null)
                PropertyChanged(this, new DependencyPropertyChangedEventArgs());
        }

        public Step ExistingStep
        {
            get { return (Step)GetValue(ExistingStepProperty); }
            set { SetValueDp(ExistingStepProperty, value); }
        }

        public Step NewStep
        {
            get { return (Step)GetValue(NewStepProperty); }
            set { SetValueDp(NewStepProperty, value); }
        }

        public DuplicateStepDialog(Step existingStep, Step newStep)
        {
            InitializeComponent();
            this.ExistingStep = existingStep;
            this.NewStep = newStep;
        }

        public int reOrder
        {
            get { return BeforRadioButton.IsChecked == true ? -1 : (AfterRadioButton.IsChecked == true ? 1 : 0); }
        }
    }
}
